package model 
{
	import flash.utils.getQualifiedClassName;
	/**
	 * ...
	 * @author Anthony
	 */
	public class Post 
	{
		//------------------------------- statics ------------------------------\\
		
		//------------------------------ variables -----------------------------\\		
		private var _key 		: String;	
		private var _message 	: String;
		private var _answerOf	: Post;
		private var _answers 	: Array /*Post*/;
		
		//------------------------------ accessors -----------------------------\\
		public function get key() 					: String 			{ return _key; }	
		public function get message() 				: String 			{ return _message; }
		public function get answerOf() 				: Post				{ return _answerOf; } 
		public function set answerOf(father : Post) : void				{ _answerOf = father; } 
		public function get answers() 				: Array /*Post*/	{ return _answers; } 
		
		//-------------------------- public functions --------------------------\\
		public function Post(key : String, message : String) 
		{
			_key = key;
			_message = message;
			_answers = new Array();
		}
		
		public function addAnswer(post : Post) : void
		{
			_answers.push(post);
			post.answerOf = this;
		}
		
		//------------------------- private functions --------------------------\\
		
	}

}